﻿<UserControl x:Class="KSAWPFDemo.PhotoBrowser.PhotoBrowser"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:PhotoLoader="clr-namespace:PhotoLoader;assembly=PhotoLoader"
             mc:Ignorable="d" 
             Background="#33a0aFFF">
    <UserControl.Resources>
        <ControlTemplate x:Key="custonLoadingControl" TargetType="{x:Type Control}">
            <Border BorderThickness="2"
                            BorderBrush="White"
                            Background="Green"
                            Height="25"
                            Width="100"                   
                            CornerRadius="8"
                            x:Name="_thumbnailLoading">

                <TextBlock VerticalAlignment="Center" 
                                   HorizontalAlignment="Center"
                                   Text="Loading..." Foreground="White"/>

                <Border.Style>
                    <Style>
                        <Setter Property="FrameworkElement.Visibility" Value="Hidden"/>
                        <Style.Triggers>

                            <MultiDataTrigger>
                                <MultiDataTrigger.Conditions>
                                    <!--Condition Binding="{Binding Path=DisplayCustomAnimation}"
                                                       Value="True"/-->

                                    <Condition Binding="{Binding Path=(PhotoLoader:Loader.IsLoading), ElementName=_thumbnailImage}"
                                                       Value="True"/>

                                </MultiDataTrigger.Conditions>

                                <Setter Property="FrameworkElement.Visibility" 
                                                Value="Visible"/>

                            </MultiDataTrigger>
                        </Style.Triggers>
                    </Style>
                </Border.Style>
            </Border>

        </ControlTemplate>

        <Style x:Key="loadingAndErrorBorderStyle" TargetType="{x:Type Border}">
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Background" Value="Black"/>
            <Setter Property="BorderBrush" Value="White"/>
            <Setter Property="Height" Value="25"/>
            <Setter Property="Width" Value="100"/>
            <Setter Property="CornerRadius" Value="8"/>
            <Setter Property="FrameworkElement.Visibility" Value="Hidden"/>
            <Style.Triggers>

                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Path=DisplayCustomAnimation}"
                                                       Value="True"/>

                        <Condition Binding="{Binding Path=(PhotoLoader:Loader.IsLoading), ElementName=_thumbnailImage}"
                                                       Value="True"/>

                    </MultiDataTrigger.Conditions>

                    <Setter Property="FrameworkElement.Visibility" 
                                                Value="Visible"/>

                </MultiDataTrigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>
    
    <Grid Name="FullGrid">
        <Grid Name="ParentGrid" Background="Transparent"></Grid>
        
        <!-- The following grid is to overlay status-->
        <Grid Name="Status" Background="Transparent" IsHitTestVisible="False">
                <Label HorizontalAlignment="Right" 
                       VerticalAlignment="Bottom" 
                       Name="statusLabel"
                       Margin="30"
                       Foreground="#13EEDDEE"  
                       FontSize="30"                       
                       ></Label>
                <Label HorizontalAlignment="Left" 
                       VerticalAlignment="Bottom" 
                       Name="currentFolder"
                       Margin="30"
                       Foreground="#AAEEDDEE"  
                       FontSize="30"                       
                       ></Label>
                <Slider Orientation="Vertical"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Center"
                        Height="400"
                        Width="20"
                        Maximum="600"
                        Minimum="0"
                        Ticks="0, 180,260"
                        TickPlacement="TopLeft"
                        Background="DarkBlue"
                        Foreground="LightBlue"
                        Margin="30"                        
                        Name="HeightSlider"
                        />                        
            </Grid></Grid>    
</UserControl>
